import http from "@/utils/http";
import {CLIENT} from '@/common/const'

// import http from "../../modules/http";
/**
 * 获取股友自选列表
 *  @param {Object} [option]
 * @param {Number} [option.currentPage] - 当前页码
 * @param {Number} [option.pageSize] - 列表长度
 */
export function getStocks(options) {
  const url = `${CLIENT}/client/getStockFriOptionalList.htm`;
  const params = { 
    pageSize: 10,
     currentPage: 1,
      ...options 
  };
  return  http.get(url,  params);
}

/**
 * 技巧心得列表
 * @param {Object} [option]
 * @param {Number} [option.currentPage] - 当前页码
 * @param {Number} [option.pageSize] - 列表长度
 */
export function getSkills(options) {
  const url = `${CLIENT}/client/skill_experienceList.htm`;
  const params = {
     pageSize: 15,
     currentPage: 1,
     ...options 
  };
  return http.get(url,  params );
}

/**
 * 股友问答列表
 * @param {Object} [option]
 * @param {Number} [option.currentPage] - 当前页码
 * @param {Number} [option.pageSize] - 列表长度
 */
export function getQuestion(options) {
  const url = `${CLIENT}/client/stock_quizList.htm`;
  const params = {
     pageSize: 10,
     currentPage: 1,
     ...options
   };
  return http.get(url, params);
}

/**
 * 获取免费录播视频
 * @param {Object} [option]
 * @param {Number} [option.currentPage] - 当前页码
 * @param {Number} [option.pageSize] - 列表长度
 */
export function getRecordLivelist(options) {
  const url = `${CLIENT}/client/queryRecordliveList.htm`;
  const params = {
    pageSize: 20,
    currentPage: 1,
    productId: 3,
    ...options,
  };
  return http.get(url, params);
  
}
/**
 * 获取收费录播视频
 * @param <String> productId: 产品ID
 * @return <Promise> Object
 */
export const queryRecordChargeLiveList = async (option) => {
  const url = `${CLIENT}/client/queryRecordChargeLiveList.htm`;
  const def = {
    currentPage: 1,
    pageSize: 3,
    productId: "",
    ...option,
  };
  const params = Object.assign(def, option);
  return http.get(url,  params );
};

/**
 * 获取免费版直播预告
 * @param {Object} [option]
 * @param {Number} [option.currentPage] - 当前页码
 * @param {Number} [option.pageSize] - 列表长度
 */
export function getMarketLivelist(options) {
  const url = `${CLIENT}/client/queryShowYeMarketLiveList.htm`;
  const params = { productId: 3, ...options };
  return http.get(url, params);
}
/**
 * 获取收费版直播预告
 * @param <String> productId: 产品ID
 * @return <Promise> Object
 */
export function queryShowYeMarketChargeLiveList(options) {
  const url = `${CLIENT}/client/queryShowYeMarketChargeLiveList.htm`;
  const params={
    ...options
  }
  return http.get(url,  params);
};

